﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server">
	Quản lý khuyến mãi
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Quản lý khuyến mãi</h2>
    <% using (Html.BeginForm())
       { 
       Html.RenderPartial("QLKhuyenMaiButton"); %>
    <div>
        <fieldset>
            <legend>Danh sách khuyến mãi</legend>
            <table>
                <tbody>
                    <tr>
                        <th><input type="checkbox" name="checkAll" /></th>
                        <th>Chuyến xe ID</th>
                        <th>Phần trăm</th>
                        <th>Ngày bắt đầu</th>
                        <th>Ngày kết thúc</th>
                        <th colspan="2"  align="center">Lựa chọn</th>
                    </tr>
                    <%
           Dictionary<int, string> LoaiXe = (Dictionary<int, string>)ViewData["LoaiXe"];
           Dictionary<int, string> TinhTrangXe = (Dictionary<int, string>)ViewData["TinhTrangXe"];
           foreach (DTO.KhuyenMaiDTO khuyenmai in (List<DTO.KhuyenMaiDTO>)ViewData["dsKhuyenmai"])
           {  %>
                    <tr>
                        <td><input type="checkbox" name="check[<% Response.Write(khuyenmai.Id); %>]" /></td>
                        <td><% Response.Write(khuyenmai.Id); %></td>
                        <td><% Response.Write(khuyenmai.Phantram); %></td>
                        <td><% Response.Write(khuyenmai.Batdau); %></td>
                        <td><% Response.Write(khuyenmai.Ketthuc); %></td>
                        <td align="center"> <%: Html.ActionLink("Sửa", "Sua", "QLKhuyenMai", new { id = khuyenmai.Id }, null)%></td>
                    </tr>
                    <%
           } %>
                </tbody>
            </table>
        </fieldset>
    </div>
    <% } %>
</asp:Content>
